home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / XLisp-Stat / Book / boxcox.lsp < prev    next >
Lisp/Scheme  |  1990-10-11  |  667b  |  27 lines

  1. ; book pp.298-299
  2.  
  3. (require "data/tutorial")
  4.  
  5. (let ((ranks (rank precipitation)))
  6.   (setf nq (normal-quant (/ (+ ranks 1) 31))))
  7.  
  8. (defun bc (x p)
  9.   (let* ((bcx (if (< (abs p) .0001)
  10.                   (log x)
  11.                   (/ (^ x p) p)))
  12.          (max (max bcx))
  13.          (min (min bcx)))
  14.   (/ (- bcx min) (- max min))))
  15.  
  16. (setf pl (plot-points nq (bc precipitation 1)))
  17. (setf indices (iseq 30))
  18.  
  19. (defun change-power (p)
  20.   (send pl :point-coordinate 1 indices (bc precipitation p))
  21.   (send pl :redraw-content))
  22.  
  23. (send pl :abline .5 .25)
  24. (setf slider (interval-slider-dialog '(-1 2) :action #'change-power))
  25. (send slider :value 1)
  26. (send pl :add-subordinate slider)
  27.